import request from '@/utils/request'
import qs from 'qs'

const baseUrl = '/food'

export function reqUpdateOrAdd(data) {
    return request({
        url: `${baseUrl}`,
        method: 'post',
        data: data
    })
}

export function reqPage(pageNum, pageSize, queryParams) {

    let query = {
        pageNum,
        pageSize,
        ...queryParams
    }
    return request({
        url: `${baseUrl}/page`,
        method: 'post',
        data: query
    })
}

export function reqGetById(id) {
    return request({
        url: `${baseUrl}/${id}`,
        method: 'get',
    })
}

export function reqDelete(ids) {
    return request({
        url: `${baseUrl}/${ids}`,
        method: 'delete',
    })
}